   cd, current = old_dir

   outputpath = old_dir + '/figures'
   if not file_test(outputpath) then file_mkdir, outputpath
   content = ''
   openr, lun, 'parameters',/get_lun
   while eof(lun) ne 1 do begin
      readf, lun, content
      if strpos(content, 'datavis_path') ne -1 then begin
         path_start = strpos(content, "'") + 1
         path_end = strpos(content, "'", /reverse_offset)
         datapath = old_dir + '/' + strmid(content, path_start, path_end - path_start)
      endif
   endwhile
   close, lun
   free_lun, lun

   xsize = 800
   ysize = 1600
   ps = 0
   char_color = 0
   line_color = 255
   background = 255
   rgb_table = -1
;   plot_range = [-0.1, 0.1, -0.2, 0.60]

   map_plot_2d, var_name = 'gp', contour_name = 'az', outputpath = outputpath, datapath = datapath, plot_range = plot_range, $
      xsize = xsize, ysize = ysize, ps = ps, char_color = char_color, line_color = line_color, background = background,            $
      rgb_table = rgb_table, mag_lv = 11, arrow_len = 0.5, colorbar_flag = 1, arrow_ny = 32,  arrow_nx = 16,               $
      time_start = 21, time_end = 21, mesh_flag = 0, var_out = var

;   nt = 51
;   v_i = fltarr(nt)
;   t = fltarr(nt)
;   v_a = 1.0
;   for time = 1, nt do begin
;      map_plot_2d, datapath = datapath, readdata_only = 1, time_start = time, time_end = time, var_out = var
;      v_i[time - 1] = max(abs(var.vv[*, 128, 0]))
;      t[time - 1] = var.t
;   endfor

;   ps = 1 & xsize = 1200 & ysize = 1200
;   usr_var, xsize, ysize
;   save_info, entry_info
;   usr_color & usr_font

;   pos = 160

;   print, var.y[pos]
;   varname = var.ro[*, pos]

;   file = 'ro'
;   usr_plot_sys, entry_dev, image_name = file, xsize = xsize, ysize = ysize, /start, /pixmap, ps = ps
;   plot, var.x, varname, color = 0, background = 255, xstyle = 1, ystyle = 1, xrange = [-0.2, 0.2],              $
;            xtitle = 'x', ytitle = 'y', title = 'Density', posi = [0.20, 0.20, 0.85, 0.85],        $
;            charsize = !usr_chars, thick = !usr_thick, charthick = !usr_chart, xthick = !usr_xthick, ythick = !usr_ythick
;   usr_plot_sys, entry_dev, image_name = file, /done, ps = ps

;   varname = var.gp[*, pos]
;   file = 'gp'
;   usr_plot_sys, entry_dev, image_name = file, xsize = xsize, ysize = ysize, /start, /pixmap, ps = ps
;   plot, var.x, varname, color = 0, background = 255, xstyle = 1, ystyle = 1, xrange = [-0.2, 0.2],              $
;            xtitle = 'x', ytitle = 'y', title = 'Gas Pressure', posi = [0.20, 0.20, 0.85, 0.85],        $
;            charsize = !usr_chars, thick = !usr_thick, charthick = !usr_chart, xthick = !usr_xthick, ythick = !usr_ythick
;   usr_plot_sys, entry_dev, image_name = file, /done, ps = ps

;   varname = var.vv[*, pos, 0]
;   file = 'vx'
;   usr_plot_sys, entry_dev, image_name = file, xsize = xsize, ysize = ysize, /start, /pixmap, ps = ps
;   plot, var.x, varname, color = 0, background = 255, xstyle = 1, ystyle = 1, xrange = [-0.2, 0.2],              $
;            xtitle = 'x', ytitle = 'y', title = 'Velocity (x-component)', posi = [0.20, 0.20, 0.85, 0.85],        $
;            charsize = !usr_chars, thick = !usr_thick, charthick = !usr_chart, xthick = !usr_xthick, ythick = !usr_ythick
;   oplot, [-0.2, 0.2], [0, 0], color = 0, thick = !usr_thick, linestyle = 2
;   usr_plot_sys, entry_dev, image_name = file, /done, ps = ps

;   varname = var.vv[*, pos, 1]
;   file = 'vy'
;   usr_plot_sys, entry_dev, image_name = file, xsize = xsize, ysize = ysize, /start, /pixmap, ps = ps
;   plot, var.x, varname, color = 0, background = 255, xstyle = 1, ystyle = 1, xrange = [-0.2, 0.2],              $
;            xtitle = 'x', ytitle = 'y', title = 'Velocity (y-component)', posi = [0.20, 0.20, 0.85, 0.85],        $
;            charsize = !usr_chars, thick = !usr_thick, charthick = !usr_chart, xthick = !usr_xthick, ythick = !usr_ythick
;   oplot, [-0.2, 0.2], [0, 0], color = 0, thick = !usr_thick, linestyle = 2
;   usr_plot_sys, entry_dev, image_name = file, /done, ps = ps

;   varname = (var.bv[*, pos, 0] ^ 2 + var.bv[*, pos, 1] ^ 2) / 2
;   file = 'b2'
;   usr_plot_sys, entry_dev, image_name = file, xsize = xsize, ysize = ysize, /start, /pixmap, ps = ps
;   plot, var.x, varname, color = 0, background = 255, xstyle = 1, ystyle = 1, xrange = [-0.2, 0.2],              $
;            xtitle = 'x', ytitle = 'y', title = 'Magnetic Pressure', posi = [0.20, 0.20, 0.85, 0.85],        $
;            charsize = !usr_chars, thick = !usr_thick, charthick = !usr_chart, xthick = !usr_xthick, ythick = !usr_ythick
;   usr_plot_sys, entry_dev, image_name = file, /done, ps = ps

;   file = 'rr'
;   usr_plot_sys, entry_dev, image_name = file, xsize = xsize, ysize = ysize, /start, /pixmap, ps = ps
;   plot, t, v_i / v_a, color = 0, background = 255, xstyle = 1, ystyle = 1,              $
;            xtitle = 'x', ytitle = 'V!din!n/V!dA!n', title = 'Reconnection Rate', posi = [0.20, 0.20, 0.85, 0.85],        $
;            charsize = !usr_chars, thick = !usr_thick, charthick = !usr_chart, xthick = !usr_xthick, ythick = !usr_ythick
;   usr_plot_sys, entry_dev, image_name = file, /done, ps = ps

   cd, old_dir

end
